/*******************************************************************************
 * Package: com.hngtrust.iir.material.controller
 * Type:    MaterialPreController
 * Date:    2021/11/12 16:34
 *
 * Copyright (c) 2021 HUANENG GUICHENG TRUST CORP.,LTD All Rights Reserved.
 *
 * You may not use this file except in compliance with the License.
 *******************************************************************************/
package com.hngtrust.iir.material.controller;


import com.hngtrust.framework.bind.ResponseInfo;
import com.hngtrust.iir.material.dto.MaterialPreDTO;
import com.hngtrust.iir.material.service.PrivateMaterialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 资料统计
 *
 * @author Chaidd
 * @date 2021/11/12 16:34
 */
@Slf4j
@RestController
@RequestMapping("/material-pre")
@Api(tags = "资料统计")
public class MaterialPreController {


    @Autowired
    private PrivateMaterialService privateMaterialService;

    @ApiOperation(value = "上传部门统计", notes = "上传部门统计")
    @PostMapping("/statis-dept-name")
    public ResponseInfo<List<MaterialPreDTO>> statisDeptName(){
        log.info("publish_dept_name start...");
        List<MaterialPreDTO> materialPreDTO = privateMaterialService.statisDeptName();
        return new ResponseInfo(materialPreDTO);
    }

    @ApiOperation(value = "报告类型统计", notes = "报告类型统计")
    @PostMapping("/statis-material-type")
    public ResponseInfo<List<MaterialPreDTO>> statisMaterialType(){
        log.info("statis-material-type start...");
        List<MaterialPreDTO> materialPreDTO = privateMaterialService.statisMaterialType();
        return new ResponseInfo(materialPreDTO);
    }

    @ApiOperation(value = "行业类型统计", notes = "行业类型统计")
    @PostMapping("/statis-industry_name")
    public ResponseInfo<List<MaterialPreDTO>> statisIndustryName(){
        log.info("statis-industry_name start...");
        List<MaterialPreDTO> materialPreDTO = privateMaterialService.statisIndustryName();
        return new ResponseInfo(materialPreDTO);
    }

    
}
